#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
#include<algorithm>
int main()
{
    long long x, y, minv = -1, maxv = 1000000000;
    int n = 0;
    cin >> n;
        while (n--)
        {
            scanf("%lld%lld", &x, &y);
            maxv = min(maxv, x / y);
            minv = max(minv, x / (y + 1) + 1);
        }
    cout << minv << " " << maxv;
    return 0;
}